home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MATHS / RLAB / RLAB125.ZIP / !RLaB / misc / loaddir_ux < prev    next >
Text File  |  1995-08-21  |  681b  |  30 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. //  Syntax:     loaddir ( DIRNAME )
  4.  
  5. //  Description:
  6.  
  7. //  loaddir loads all of the Rfiles in the directory DIRNAME. DIRNAME
  8. //  is a string identifying the directory of Rfiles to be loaded. Only
  9. //  files with a postfix of `.r' will be loaded.
  10.  
  11. //  Example: 
  12. //  > loaddir ("/u1/ian/rlab/testmatrix");
  13. //  > loaddir (".");
  14.  
  15. //-------------------------------------------------------------------//
  16.  
  17.  
  18. loaddir_ux = function ( dir )
  19. {
  20.   local (dir)
  21.  
  22.   dirnm = "| ls " + dir + "/*.r";
  23.   while (length (fn = getline (dirnm)))
  24.   {
  25.     printf ("\tLoading:\t%s\n", fn.[1]);
  26.     load (fn.[1]);
  27.   }
  28.   close (dirnm);
  29. };
  30.